package com.budwk.app.sys.commons.task.job;

import com.budwk.app.sys.services.TaskJobForCommonHandleService;
import com.budwk.starter.job.annotation.SJob;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

/**
 * @program: dfxy-community
 * @description: 公共业务处理定时任务
 * @author: LJT
 * @create: 2023-12-20 10:26
 **/
@IocBean(name = "TaskJobForCommonHandle", singleton = false)
@Slf4j
public class TaskJobForCommonHandle {

    @Inject
    TaskJobForCommonHandleService taskJobForCommonHandleService;

    /**
     * 定时更新本地图片
     * 每天凌晨从云端下载到本地
     *
     * @param taskId
     * @param params
     * @throws JsonProcessingException
     */
    @SJob("updateLocalPictureTaskJob")
    public void updateLocalPictureTaskJob(String taskId, String params) throws JsonProcessingException {
        // 调用定时任务服务接口
        taskJobForCommonHandleService.updateLocalPictureTaskJob();
    }
}
